<template>
	<div class="richTips">
		<rich-text :nodes="nodes"></rich-text>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				nodes: '',
			}
		},
		onLoad(option) {
			this.gettext(option.type)
			if(option.type == 1){
				uni.setNavigationBarTitle({
					title:'用户协议'
				})
			}else if(option.type == 12){
				uni.setNavigationBarTitle({
					title:'隐私政策'
				})
			}
		},
		methods:{
			gettext(type){
				this.$http.get('/public/getAgreement', {
					type: type
				}).then(res => {
					if (res.code == 0) {
						this.nodes = res.data.content
						
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						});
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.richTips {
		font-size: 28upx;
		color: #22222a;
		padding: 20upx;
	}
</style>
